package com.lagou.common;

import lombok.Data;

/**
 * @ClassName Response
 * @Description
 * @Author playboy
 * @Date 2021/6/26 2:44 下午
 * @Version 1.0
 **/
@Data
public class Response {
	private Boolean flag;

	private String msg;

	private Object data;

	private Response() {

	}

	public static Response getInstance() {
		return new Response();
	}

	public static Response getSuccessResponse(String msg, Object data) {
		Response response = new Response();
		response.setFlag(true);
		response.setMsg(msg);
		response.setData(data);
		return response;
	}

	public static Response getFailResponse(String msg, Object data) {
		Response response = new Response();
		response.setFlag(false);
		response.setMsg(msg);
		response.setData(data);
		return response;
	}

}
